package eraikikon2;

import java.awt.BorderLayout;
import java.awt.Color;

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Dimension;

public class TxartelarenDatuakAtera extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;
	
	private ErabKud ek = new ErabKud();
	
	private Txartela tx;
	

	/**
	 * This is the default constructor
	 */
	public TxartelarenDatuakAtera(Txartela txart) {
		super();
		initialize();
		tx= txart;
		Integer erabId = txart.getErabiltzaileId();
		Erabiltzaile erab = ek.getErabDatuak(erabId);
		Box box = Box.createHorizontalBox();
		Box box1 = Box.createHorizontalBox();
//		Box box2 = Box.createHorizontalBox();
		Box box3 = Box.createVerticalBox();
		Box box4 = Box.createHorizontalBox();
		JLabel jLabel = new JLabel();
		JLabel jLabel1 = new JLabel();
//		JLabel jLabel2 = new JLabel();
		JLabel jLabel3 = new JLabel();
		JLabel jLabel4 = new JLabel();
//		JLabel jLabel5 = new JLabel();
		JButton jButton = new JButton();
		jLabel.setText("       NAN:   ");
		jLabel1.setText("      Izena:   ");
//		jLabel2.setText("          Abizena:   ");
		jLabel3.setText("                 "+erab.getId().toString()+ "     ");
		jLabel4.setText("         "+erab.getIzena()+ "     ");
//		jLabel5.setText(erab.);
		jButton.setText("  Gaitu  ");
		box.add(jLabel);
		box.add(jLabel3);
		box1.add(jLabel1);
		box1.add(jLabel4);
//		box2.add(jLabel2);
//		box2.add(jLabel5);
		box3.add(box);
		box3.add(box1);
//		box3.add(box2);
		box4.add(box3);
		box4.add(jButton);
		jContentPane.add(box4,BorderLayout.NORTH );
		jButton.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent e) {
				TxartelKud tk = new TxartelKud();
				tk.txGaitu(tx);
				JOptionPane.showMessageDialog(null, "Txartela gaitu da");
			}
		});
		
		
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(266, 122);
		this.setContentPane(getJContentPane());
		this.setTitle("JFrame");
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
		}
		return jContentPane;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
